import { checkUpdate } from "@/api/system/version";
import { useAuthStore } from "@/store/auth";
import { useMessageStore } from "@/store/message";
import { getVersion } from "@tauri-apps/api/app";

export const init = async () => {
    const authStore = useAuthStore();
    await authStore.init();
    const messageStore = useMessageStore();
    await messageStore.init();
    
}

export const doCheckUpdate = async () => {
    const appVersion = await getVersion();
    const res = await checkUpdate(appVersion);
    const update = res.data;
    return update;
}